﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="StereoSubEngine.cs" company="ScRePt">
//   Copyright © ScRePt 2010 - 2012
// </copyright>
// <summary>
//   The stereoscopic SubEngine.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace MP3D.Subtitles
{
    #region Using Directives

    using System.Drawing;

    using DirectShowLib;

    using MediaPortal.Player.Subtitles;

    #endregion

    /// <summary>
    /// The stereoscopic SubEngine.
    /// </summary>
    public abstract class StereoSubEngine : ISubEngine
    {
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="StereoSubEngine"/> class.
        /// </summary>
        /// <param name="baseEngine">
        /// The base engine.
        /// </param>
        protected StereoSubEngine(ISubEngine baseEngine)
        {
            this.BaseEngine = baseEngine;
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets AutoSaveType.
        /// </summary>
        public virtual AutoSaveTypeEnum AutoSaveType
        {
            get
            {
                return this.BaseEngine.AutoSaveType;
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether AutoShow.
        /// </summary>
        public virtual bool AutoShow
        {
            get
            {
                return this.BaseEngine.AutoShow;
            }

            set
            {
                this.BaseEngine.AutoShow = value;
            }
        }

        /// <summary>
        /// The base engine.
        /// </summary>
        public ISubEngine BaseEngine { get; private set; }

        /// <summary>
        /// Gets or sets Current.
        /// </summary>
        public virtual int Current
        {
            get
            {
                return this.BaseEngine.Current;
            }

            set
            {
                this.BaseEngine.Current = value;
            }
        }

        /// <summary>
        /// Gets or sets Delay.
        /// </summary>
        public virtual int Delay
        {
            get
            {
                return this.BaseEngine.Delay;
            }

            set
            {
                this.BaseEngine.Delay = value;
            }
        }

        /// <summary>
        /// Gets DelayInterval.
        /// </summary>
        public virtual int DelayInterval
        {
            get
            {
                return this.BaseEngine.DelayInterval;
            }
        }

        /// <summary>
        /// Gets or sets a value indicating whether Enable.
        /// </summary>
        public virtual bool Enable
        {
            get
            {
                return this.BaseEngine.Enable;
            }

            set
            {
                this.BaseEngine.Enable = value;
            }
        }

        /// <summary>
        /// Gets or sets HorizontalParallax.
        /// </summary>
        public virtual int HorizontalParallax { get; set; }

        /// <summary>
        /// Gets or sets OutputFormat.
        /// </summary>
        public virtual int OutputFormat { get; set; }

        /// <summary>
        /// Gets or sets VerticalParallax.
        /// </summary>
        public virtual int VerticalParallax { get; set; }

        /// <summary>
        /// Gets or sets VideoHeight.
        /// </summary>
        public virtual int VideoHeight { get; set; }

        /// <summary>
        /// Gets or sets VideoWidth.
        /// </summary>
        public int VideoWidth { get; set; }

        #endregion

        #region Implemented Interfaces

        #region ISubEngine

        /// <summary>
        /// The delay minus.
        /// </summary>
        public virtual void DelayMinus()
        {
            this.BaseEngine.DelayMinus();
        }

        /// <summary>
        /// The delay plus.
        /// </summary>
        public virtual void DelayPlus()
        {
            this.BaseEngine.DelayPlus();
        }

        /// <summary>
        /// The free subtitles.
        /// </summary>
        public virtual void FreeSubtitles()
        {
            this.BaseEngine.FreeSubtitles();
        }

        /// <summary>
        /// The get count.
        /// </summary>
        /// <returns>
        /// The get count.
        /// </returns>
        public virtual int GetCount()
        {
            return this.BaseEngine.GetCount();
        }

        /// <summary>
        /// The get language.
        /// </summary>
        /// <param name="i">
        /// The i.
        /// </param>
        /// <returns>
        /// The get language.
        /// </returns>
        public virtual string GetLanguage(int i)
        {
            return this.BaseEngine.GetLanguage(i);
        }

        /// <summary>
        /// The get subtitle name.
        /// </summary>
        /// <param name="i">
        /// The i.
        /// </param>
        /// <returns>
        /// The get subtitle name.
        /// </returns>
        public virtual string GetSubtitleName(int i)
        {
            return this.BaseEngine.GetSubtitleName(i);
        }

        /// <summary>
        /// The is modified.
        /// </summary>
        /// <returns>
        /// The is modified.
        /// </returns>
        public virtual bool IsModified()
        {
            return this.BaseEngine.IsModified();
        }

        /// <summary>
        /// The load subtitles.
        /// </summary>
        /// <param name="graphBuilder">
        /// The graph builder.
        /// </param>
        /// <param name="filename">
        /// The filename.
        /// </param>
        /// <returns>
        /// The load subtitles.
        /// </returns>
        public virtual bool LoadSubtitles(IGraphBuilder graphBuilder, string filename)
        {
            return this.BaseEngine.LoadSubtitles(graphBuilder, filename);
        }

        /// <summary>
        /// The render.
        /// </summary>
        /// <param name="subsRect">
        /// The subs rect.
        /// </param>
        /// <param name="frameRect">
        /// The frame rect.
        /// </param>
        public virtual void Render(Rectangle subsRect, Rectangle frameRect)
        {
            this.BaseEngine.Render(subsRect, frameRect);
        }

        /// <summary>
        /// The save to disk.
        /// </summary>
        public virtual void SaveToDisk()
        {
            this.BaseEngine.SaveToDisk();
        }

        /// <summary>
        /// The set time.
        /// </summary>
        /// <param name="nssampleTime">
        /// The ns sample time.
        /// </param>
        public virtual void SetTime(long nssampleTime)
        {
            this.BaseEngine.SetTime(nssampleTime);
        }

        #endregion

        #endregion
    }
}